#!/bin/bash

ospkg_update()
{
	$SUDO pacman -Syy
}

ospkg_install()
{
	local err=

	for pkg
	do
		$SUDO pacman -Qq --noconfirm $pkg > /dev/null ||
		$SUDO pacman -Syq --noconfirm  --needed $pkg >/tmp/pacman_info 2>&1 || err=$?
		[ -f /tmp/pacman_info ] && grep -v "warning: could not get file information for *" /tmp/pacman_info
	done

	return $err
}

ospkg_list()
{
	pacman -Ss | grep -E -o '^[a-z]+/[^ ]+' | cut -f2 -d/ |
		grep -v -E '\-(docs)$' | sort -u
}
